package com.example.service.impl;

import com.example.service.DubboDemoService2;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.apache.dubbo.config.annotation.Method;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

@Slf4j
@Service("DubboDemoService2")
public class DubboDemoServiceImpl2 implements DubboDemoService2 {

    @Value("${node.type:PRD}")
    private String nodeType;

    @Override
    public String getServiceInfo(String consumerName) {
        log.info("Service2 called by {} from {} provider", consumerName, nodeType);
        return "Service2 called by " + consumerName + " from " + nodeType + " provider";
    }
}